enum {
PROP_0,
PROP_ACTIONS,
+ PROP_CURRENT_DROP,
PROP_DROP,
PROP_FORMATS,
PROP_PRELOAD,
g_clear_object (&self->drop);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_DROP]);
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CURRENT_DROP]);
if (G_IS_VALUE (&self->value))
{
self->drop = g_object_ref (drop);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_DROP]);
+ g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CURRENT_DROP]);
if (self->preload)
gtk_drop_target_load (self);
break;
case PROP_DROP:
+ case PROP_CURRENT_DROP:
g_value_set_object (value, self->drop);
break;
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
- * GtkDropTarget:drop: (attributes org.gtk.Property.get=gtk_drop_target_get_drop)
+ * GtkDropTarget:drop: (attributes org.gtk.Property.get=gtk_drop_target_get_drop) (skip)
*
* The `GdkDrop` that is currently being performed.
+ *
+ * Deprecated: 4.4: Use [property@Gtk.DropTarget:current-drop] instead
*/
properties[PROP_DROP] =
g_param_spec_object ("drop",
P_("Drop"),
P_("Current drop"),
GDK_TYPE_DROP,
+ GTK_PARAM_READABLE | G_PARAM_DEPRECATED);
+
+ /**
+ * GtkDropTarget:current-drop: (attributes org.gtk.Property.get=gtk_drop_target_get_current_drop)
+ *
+ * The `GdkDrop` that is currently being performed.
+ *
+ * Since: 4.4
+ */
+ properties[PROP_CURRENT_DROP] =
+ g_param_spec_object ("current-drop",
+ P_("Current drop"),
+ P_("Current drop"),
+ GDK_TYPE_DROP,
GTK_PARAM_READABLE);
/**
* If no drop operation is going on, %NULL is returned.
*
* Returns: (nullable) (transfer none): The current drop
+ *
+ * Deprecated: 4.4: Use [method@Gtk.DropTarget.get_current_drop] instead
*/
GdkDrop *
gtk_drop_target_get_drop (GtkDropTarget *self)
return self->drop;
}
+/**
+ * gtk_drop_target_get_current_drop: (attributes org.gtk.Method.get_property=current-drop)
+ * @self: a `GtkDropTarget`
+ *
+ * Gets the currently handled drop operation.
+ *
+ * If no drop operation is going on, %NULL is returned.
+ *
+ * Returns: (nullable) (transfer none): The current drop
+ *
+ * Since: 4.4
+ */
+GdkDrop *
+gtk_drop_target_get_current_drop (GtkDropTarget *self)
+{
+ g_return_val_if_fail (GTK_IS_DROP_TARGET (self), NULL);
+
+ return self->drop;
+}
+
/**
* gtk_drop_target_get_value: (attributes org.gtk.Method.get_property=value)
* @self: a `GtkDropTarget`
*
* Rejects the ongoing drop operation.
*
- * If no drop operation is ongoing, i.e when [property@Gtk.DropTarget:drop]
+ * If no drop operation is ongoing, i.e when [property@Gtk.DropTarget:current-drop]
* is %NULL, this function does nothing.
*
* This function should be used when delaying the decision
gtk_drop_target_end_drop (self);
}
+